﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LLComment.aspx.cs" Inherits="HelloLLLLL.Blog.Admin.page.LLComment" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>layui</title>
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <link rel="stylesheet" href="../lib/layui-v2.5.5/css/layui.css" media="all" />
    <link rel="stylesheet" href="../css/public.css" media="all" />
</head>
<body>
  
<div class="layui-form">
      <table class="layui-table" lay-skin="line">
  <colgroup>
    <col width="450">
    <col width="90">
    <col width="180">
    <col width="80">
  </colgroup>
  <thead>
    <tr>
      <th>标题</th>
      <th>作者</th>
      <th>日期</th>
      <th>操作</th>
    </tr> 
  </thead>
  <tbody id="llContent">
     
  </tbody>
</table>   
  </div>
     <div id="demo7"></div>
      <script src="../lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script src="../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
    layui.use(['laypage'], function () {

        var laypage = layui.laypage;

        //完整功能
        laypage.render({
            elem: 'demo7'
            , count: <%=PageCount%>
            , layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
            , limit:6
            , jump: function (obj) {
                $.ajax({
                    url: "/admin/AdminPostData.ashx?action=getCommentList&page=" + obj.curr + "&limit=" + obj.limit,
                    type: 'GET',
                    dataType: "JSON",
                    success: function (dd) {
                        //console.log(data);
                        if (dd.code == 1) {
                            var str = '';
                            if (dd.data != null) {
                            for (var i = 0; i < dd.data.length; i++) {
                                var item = dd.data[i];
                                var td = '<tr style="background: #009688; color:#fff">'
                                    + '<<td>Re:<a style="color: #fff" href="/html/Detail.aspx?Id='+item.ArtId+'" target="_blank">'+item.ArtTitle+'</a></td>'
                                        + '<td>'+item.Pubnisher+'</td>'
                                        + '<td>'+item.PubnishTime+'</td>'
                                    + '<td><a style="color: #fff" href="LLComment.aspx?action=delete&id='+ item.Id +'" class="ll_Delete">删除</a></td>'
                                        + ' </tr>'
                                        + ' <tr style="display: inline-block;">'
                                        + ' <td colspan="4" style="margin-left:100px; display: inline-block;">'
                                    + item.Content+ ' </td></tr>';

                                str += td;

                            }
                            }
                            $("#llContent").html(str);
                        }

                    },
                    error: function (response) {
                        console.log(response);
                    }
                });

            }
        });
    });
</script>
</body>
</html>
